package appgui;

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextArea;
import javax.swing.JButton;
import javax.swing.JTextField;
import org.eclipse.wb.swing.FocusTraversalOnArray;
import java.awt.Component;

@SuppressWarnings("serial")
public class TextInputFrame extends JFrame {

	private JPanel contentPane;
	private JTextField txtRecipeName;
	private JTextArea txtareaRecipeInput; 

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TextInputFrame frame = new TextInputFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public TextInputFrame() {
		setTitle("Enter recipe");
		setResizable(false);
		setAlwaysOnTop(true);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		txtareaRecipeInput= new JTextArea();


		txtareaRecipeInput.setText("Type recipe here");
		txtareaRecipeInput.setBounds(20, 6, 408, 216);
		contentPane.add(txtareaRecipeInput);
		
		JButton btnCreateRecipe = new JButton("Create Recipe!");
		btnCreateRecipe.setBounds(307, 234, 117, 29);
		contentPane.add(btnCreateRecipe);
		
		txtRecipeName = new JTextField();
		txtRecipeName.setText("Recipe name");
		txtRecipeName.setBounds(30, 234, 134, 28);
		contentPane.add(txtRecipeName);
		txtRecipeName.setColumns(10);
		setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{txtareaRecipeInput, txtRecipeName, btnCreateRecipe}));
	}
}
